/**
 * 
 */
package Library.devices;

import java.sql.SQLException;

import Library.Device;
import Library.DeviceInterface;
import Library.DeviceManager;

/**
 * @author Hardeep
 *
 */
public class MediaDevice extends Device implements DeviceInterface {
	/**
	 * The type of Device. Generally tells what kind of data the Device is
	 * designed to store. 
	 */
	public static String DEVICE_TYPE = "media";
	
	/**
	 * If this is True, a user may create this device from the UI.
	 */
	public boolean accessible = true;
	
	public MediaDevice(String deviceName) throws SQLException {
		super(deviceName);
	}
	
	/**
	 * A MediaDevice instance for registration purposes.
	 */
	public MediaDevice() {
		super();
	}

	/**
	 * Create and return a new instance of this MediaDevice, with the given name.
	 * @return the new device instance.
	 * @throws SQLException 
	 */
	public DeviceInterface getNewDeviceInstance(String name) throws SQLException {
		return new MediaDevice(name);
	}
	
	/**
	 * Register this Device with the DeviceManager.
	 */
	public static void registerDevice() {
		MediaDevice r = new MediaDevice();
		DeviceManager.registerDeviceType(DEVICE_TYPE, r);
	}
}
